package com.forum.module.system.convert.feedback;

import com.forum.framework.common.util.colletion.CollectionUtils;
import com.forum.framework.common.util.object.BeanUtils;
import com.forum.module.system.controller.admin.feedback.vo.FeedBackRespVO;
import com.forum.module.system.dal.dataobject.feedback.FeedBackDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 功能:
 * 作者:ouyzh
 * 日期:2025/3/19 21:32
 */
@Mapper
public interface FeedBackConvert {
    FeedBackConvert INSTANCE = Mappers.getMapper(FeedBackConvert.class);

    default List<FeedBackRespVO> covertList(List<FeedBackDO> list) {
        return CollectionUtils.convertList(list, this::covert);
    }

    default FeedBackRespVO covert(FeedBackDO feedBackDO) {
        return BeanUtils.toBean(feedBackDO, FeedBackRespVO.class);
    }
}
